package cn.bfay.lion.jingdong.client.rsp;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.List;

/**
 * 商品促销返回.
 *
 * @author wangjiannan
 */
@Data
public class JdProductPromotionResult {
    /**
     * errcode.
     */
    private String errcode;
    /**
     * errmsg.
     */
    private String errmsg;
    /**
     * data.
     */
    private List<ResultData> data;

    @Data
    public static class ResultData {
        /**
         * id.
         */
        private String id;
        /**
         * pis.
         */
        private List<PromotionInfo> pis;

        @Data
        public static class PromotionInfo {
            /**
             * 开始时间(10位).
             */
            private String st;
            /**
             * subextinfo.
             */
            private String subextinfo;
            /**
             * etg.
             */
            private String etg;

            @JsonProperty("26")
            private String _26;
            /**
             * customtag.
             */
            private String customtag;
        }
    }

    @Data
    public static class Subextinfo {
        /**
         * extType.
         */
        private Integer extType;
        /**
         * subExtType.
         */
        private Integer subExtType;
        /**
         * needMoney.
         */
        private String needMoney;
        /**
         * rewardMoney.
         */
        private String rewardMoney;
        /**
         * percent.
         */
        private String percent;
        /**
         * subRuleList.
         */
        private List<SubRuleList> subRuleList;

        @Data
        public static class SubRuleList {
            /**
             * needMoney.
             */
            private String needMoney;
            /**
             * rewardMoney.
             */
            private String rewardMoney;
            /**
             * needNum.
             */
            private String needNum;
            /**
             * rebate.
             */
            private String rebate;
        }
    }

    @Data
    public static class Customtag {
        @JsonProperty("p")
        private String price;

        private String discount;
    }
}
